import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register')
  },
  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/login',
    children: [
      {
        path: '/doctor/message',
        name: '医生信息管理',
        component: () => import('@/views/doctorMessage')
      },
      {
        path: '/doctor/worktime',
        name: '医生排班管理',
        component: () => import('@/views/worktime')
      },
      {
        path: '/user/message',
        name: '用户信息管理',
        component: () => import('@/views/users')
      },
      {
        path: '/user/recode',
        name: '用户预约管理',
        component: () => import('@/views/recode')
      },
      {
        path: '/admin/message',
        name: '管理员信息管理',
        component: () => import('@/views/admin')
      },
      {
        path: '/hospital/room',
        name: '办公室信息管理',
        component: () => import('@/views/room')
      },
      {
        path: '/hospital/office',
        name: '科室信息管理',
        component: () => import('@/views/office')
      },
      {
        path: '/doctor/apply',
        name: '医生调班申请管理',
        component: () => import('@/views/apply')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
